package cn.wsn2018.tools.ctrl;

import cn.wsn2018.tools.model.RsaObj;
import cn.wsn2018.tools.service.RsaKeyService;
import cn.wsn2018.tools.util.JsonUtil;
import cn.wsn2018.tools.util.ServletUtil;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
* @Description: 请求rsa公钥
* @Param:
* @return:
* @Author: SongDaisong
* @Date:  2020/2/10 17:12
*/
@RestController
@RequestMapping("/protocol")
public class RsakeyController {

    @Autowired
    private RsaKeyService rsaKeyService;


    @CrossOrigin
    @RequestMapping(value = "/getpublickey",method = RequestMethod.GET)
    public void getPubicKey(HttpServletResponse response) throws Exception {
        String msg = rsaKeyService.getPublickKey();
        ServletUtil.getInstance().responseOperating(response,msg);
    }
}
